//
//  RCDListCell.m
//  League
//
//  Created by 崔璨 on 2018/2/5.
//  Copyright © 2018年 ciyuanjuzhen. All rights reserved.
//

#import "RCDListCell.h"
#import "UIView+Frame.h"

@implementation RCDListCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupUI];
    }
    return self;
}

-(void)setupUI{
    self.avtar = [[UIImageView alloc] initWithFrame:CGRectMake(10, self.contentView.center.y, 60, 60)];
    self.avtar.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.avtar];
    
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(80, self.avtar.y, 100, 20)];
    self.nameLabel.text = @"--";
    [self.contentView addSubview:self.nameLabel];
    
    self.infoOen = [[UILabel alloc] initWithFrame:CGRectMake(80, self.nameLabel.y+20, 100, 20)];
    self.infoOen.text = @"--";
    [self.contentView addSubview:self.infoOen];
    
    self.infoTwo = [[UILabel alloc] initWithFrame:CGRectMake(80, self.infoOen.y+20, 100, 20)];
    self.infoTwo.text = @"--";
    [self.contentView addSubview:self.infoTwo];
    
    self.lastMessage = [[UILabel alloc]initWithFrame:CGRectMake(80, self.infoTwo.y+20, 100, 20)];
    self.lastMessage.text = @"--";
    [self.contentView addSubview:self.lastMessage];
    self.rematchBtn = [[UIButton alloc] initWithFrame:CGRectMake(80, self.infoTwo.y+20, 100, 20)];
    [self.rematchBtn setTitle:@"随便写" forState:UIControlStateNormal];
    [self.rematchBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [self.contentView addSubview:self.rematchBtn];
}

-(void)setIsShow:(BOOL)isShow{
    if (isShow) {
        self.lastMessage.hidden = YES;
        self.rematchBtn.hidden = NO;
    }else{
        self.lastMessage.hidden = NO;
        self.rematchBtn.hidden = YES;
    }
}

@end
